home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / Little Smalltalk v3.1.4 / Documentation / List of primitives < prev    next >
Encoding:
Text File  |  1994-11-03  |  10.6 KB  |  352 lines  |  [ttro/ttxt]

  1.                   A List of all Primitives in the Little Smalltalk System
  2.                  ==================================================
  3.  
  4.  
  5. (Includes Macintosh Enhanced User Interface extensions)
  6.  
  7.  
  8. Primitives with no parameters
  9.  
  10.     1:         <non-existent>
  11.     2:         count of objects
  12.     3:        return a random number
  13.     4:        return time in seconds
  14.     5:        flip watch
  15.     9:        quit program
  16.  
  17. Primitives with one parameter
  18.  
  19.     11:        class of object
  20.     12:        basic size of object
  21.     13:        hash value of object
  22.     14:        debugging print
  23.     18:        change return point - block return
  24.     19:        process execute
  25.  
  26. Primitives with 2 parameters
  27.  
  28.     20:        make object 1 'become' object 2 and vice-versa
  29.     21:        object identity test
  30.     22:        set class of object
  31.     23:        debugging stuff
  32.     24:        string cat
  33.     25:        basicAt:
  34.     26:        byteAt:
  35.     27:        symbol set
  36.     28:        block start
  37.     29:        duplicate a block, adding a new context to it
  38.  
  39. Primitives with 3 parameters
  40.  
  41.     31:        basicAt:Put:
  42.     32:        basicAt:Put: for bytes
  43.     33:        string copyFrom:to:
  44.     39:        compile method
  45.  
  46. Integer primitives with one parameter
  47.  
  48.     41:        float equiv of integer
  49.     42:        print - for debugging purposes
  50.     43:        set time slice - done in interpreter
  51.     45:        set random number
  52.     48:    allocate object
  53.     49:    allocate byte array
  54.  
  55. Integer primitives with two parameters
  56.  
  57.     50:        addition
  58.     51:        subtraction
  59.     52:        <
  60.     53:        >
  61.     54:        <=
  62.     55:        >=
  63.     56: 73:    ==
  64.     57:        !=
  65.     58:        multiplication
  66.     59:        quo:
  67.     70:        rem:
  68.     71:        &=
  69.     72:        ^=
  70.     79:        >>= , <<=
  71.  
  72. String primitives with one parameter
  73.  
  74.     81:        length of string
  75.     82:     hash value of symbol
  76.     83:        string as symbol
  77.     87:        value of symbol
  78.     88:        System () call (if available)
  79.     89:        fatal error
  80.  
  81. Floating point primitives with one parameter
  82.  
  83.     101:    floating value asString
  84.     102:    log
  85.     103:    exp
  86.     106:    integer part
  87.                  return two integers n and m such that
  88.                  number can be written as n * 2** m
  89.  
  90. Floating point primitives with two parameters
  91.  
  92.     110:     +  
  93.     111:     -
  94.     112:     <
  95.     113:     >
  96.     114:     <=
  97.     115:     >=
  98.     116:     ==
  99.     117:     !=
  100.     118:     *
  101.     119:     /
  102.  
  103.  
  104. Primitives 120 - 149 are file-related operations.
  105.  
  106.     120:    Open file.    Param 1 = file name
  107.                         Param 2 = open mode
  108.                         Param 3 = file type
  109.     121:    Close file
  110.     122:    Return file size (not implemented)
  111.     123:    Interpret a text file as Little Smalltalk source.
  112.     124:    Delete file
  113.     125:    Get string (not applicable to Macintosh implementation)
  114.     127:    Write an object image.
  115.     128:    Print a string without adding a carriage return.
  116.             (not applicable to Macintosh implementation)
  117.     129:    Print a string with a carriage return.
  118.             (not applicable to Macintosh implementation)
  119.  
  120. Primitives 160 and above are system-specific. 
  121. The following are for the Macintosh Symantec(TM) C / TCL implementation.
  122.  
  123.     160:    Open different types of window
  124.             Param 1 = window number
  125.             Param 2 = action
  126.             Param 3 = window title
  127.             Param 4 = window type (0 - graphics, 1 - text, 2 - select).
  128.         Action 1: Open a window to a system decided size and location
  129.         Action 2: Open a window to specified size and loaction where:
  130.                     Param 5 = left co-ordinate
  131.                     Param 6 = top co-ordinate
  132.                     Param 7 = width
  133.                     Param 8 = height
  134.     161:    Perform a variety of simple window actions
  135.             Param 1 = window number
  136.             Param 2 = action
  137.         Action 1:    close window
  138.         Action 2,3:    no longer used
  139.         Action 4:    activate window
  140.         Action 5:    refresh the text in window (no longer used)
  141.         Action 6:    return the window's current size
  142.         Action 7:    return the window's position in global co-ordinates
  143.         Action 8:    bring window to front
  144.         Action 9:    query the 'dirty' status of the window (i.e. does any text need to be saved)
  145.         Action 10:    set the window's title
  146.  
  147.     162:    Primitives requiring a single integer parameter
  148.             Param 1 = window number
  149.             Param 2 = action
  150.             Param 3 = menu pointer or timer setting
  151.         Action 1:    set timer (not implemented)
  152.         Action 2:    attach a menu to a window
  153.         Action 3:    detach a menu from a window
  154.  
  155.     163:    Primitives requiring two integer parameters
  156.             Param 1 = window number
  157.             Param 2 = action
  158.             Param 3 = 'x' value
  159.             Param 4 = 'y' value
  160.         Action 1:    (not used)
  161.         Action 2:    set window size
  162.         Action 3:    set window origin (not implemented)
  163.  
  164.     164:    Cursors (mouse pointers)
  165.             Param 1 = action
  166.         Action 1: fetch a named cursor (either system standard or from resource fork)
  167.                     Param 2 = string containing name of cursor to fetch
  168.                     Returns: string containing a pointer to the cursor.
  169.         Action 2: show cursor
  170.                     Param 2 = cursor pointer (as returned by Action 1)
  171.         Action 3: reset to default cursor (arrow)
  172.  
  173.     165:    Text-related functions
  174.             Param 1 = pane pointer
  175.             Param 2 = action
  176.         Action 1: return all the text in the text pane
  177.         Action 2: return all the text in the currently selected area 
  178.                     of the text pane
  179.         Action 3: replace    all the text in the text pane with the specified text
  180.                     Param 3 = replacing text 
  181.         Action 4: delete all text in a pane
  182.         Action 5: change the pane's font to the named font
  183.                     Param 3 = string representing name of new font
  184.         Action 6: change the point size of all text in the pane
  185.                     Param 3 = new point size
  186.         Action 7: change the face of all text in the pane
  187.                     Param 3 = new type face
  188.         Action 8: set the text selection to the given range
  189.                     Param 3 = start of range
  190.                     Param 4 = end of range
  191.         Action 9: return the start and end positions of a selection in character
  192.                   positions, relative to the start of the text.
  193.         Action 10: scroll the text so that the current selection is visible
  194.  
  195.     166:    insert text at the current cursor position
  196.             Param 1 = pane pointer
  197.             Param 2 = string to insert
  198.         
  199.     167:    return a rectangle representing the maximum available screen area in
  200.             global co-ordinates.
  201.  
  202.     168:    window pane related functions
  203.             Param 1 = action
  204.             Param 2 = window number / pane pointer
  205.         Action 1: create a pane and attach it to the specified window
  206.                     Param 3    = pane type (1 - text, 2 - select, 3 - graphics)
  207.                     Params 4-7 = left, top, right, bottom of pane
  208.                     Params 8-9 = horizontal, vertical sizing options
  209.                   returns a string containing a pointer to the newly created pane
  210.         Action 2: return a point representing the current size of the pane
  211.         Action 3: draw the contents of a text pane, ignore for graphics panes.
  212.         Action 4: direct all further drawing operations to this pane
  213.         Action 5: notify the system that drawing is complete (not needed)
  214.  
  215.     170: getevent:    format and return the next interface event
  216.  
  217.     171:    event information returned as an integer
  218.             Param 1 = action
  219.         Action 1: return the number of the window in which the event occurred
  220.         Action 2: return the number of the selected menu
  221.         Action 3: return the number of the selected menu item
  222.         Action 4: return the most recent character typed by the user
  223.         Action 5: return the mouse's 'y' position (not used)
  224.         Action 6: return the number of the mouse button pressed
  225.         Action 7: return the number of mouse clicks
  226.         Action 8: return the most recent character typed by the user
  227.         Action 9: return the number of the command (menu shortcut) typed.
  228.  
  229.     172:    more general event information
  230.             Param 1 = action
  231.         Action 1: return a point showing where a mouse button was pressed
  232.  
  233.     180:    add a new menu
  234.             Param 1 = menu number
  235.             Param 2 = menu title
  236.             Param 3 = pop-up menu indicator
  237.             returns a string containing a pointer to the menu.
  238.  
  239.     181:    add a menu item to the end of a menu
  240.             Param 1 = menu pointer
  241.             Param 2 = item text
  242.             Param 3 = optional short-cut character
  243.  
  244.     182:    enable/disable, check/uncheck menu items
  245.             Param 1 = menu pointer
  246.             Param 2 = item number
  247.             Param 3 = action
  248.             Param 4 = flag
  249.         Action 1: enable or disable a menu item
  250.         Action 2: check or uncheck a menu item
  251.  
  252.     183:    select from a pop-up menu
  253.             Param 1 = menu pointer
  254.             Param 2 = position at which top of menu is to appear
  255.             Param 3 = position at which left side of menu is to appear
  256.             Returns: an integer indicating which item was selected
  257.         
  258.     184:    menu/menu item disposal
  259.             Param 1 = menu pointer
  260.             Param 2 = action
  261.         Action 1: dispose of a menu
  262.         Action 2: remove a menu item
  263.                     Param 3 = item number
  264.  
  265.     190:    print a string at the given pixel position
  266.             Param 1 = x location
  267.             Param 2 = y location
  268.             Param 3 = string to print
  269.  
  270.     192:    point-related functions
  271.             Param 1 = action
  272.             Param 2 = x value
  273.             Param 3 = y value
  274.         Action 1: draw a line from the current position to the given point
  275.         Action 2: move to the given point
  276.         Action 3: draw a pixel at the given point
  277.  
  278.     193:    circles and miscellaneous graphics functions
  279.             Param 1     = action
  280.             Params 2, 3 = co-ordinates for character / centre of circle
  281.             Param 4     = character to draw / radius of circle
  282.         Action 1: draw circle
  283.         Action 2: draw a single character
  284.  
  285.     194:    rectangle-related functions
  286.             Param 1 = action
  287.             Params 2-5 = left, top, right, bottom of rectangle
  288.         Action 1: frame a rectangle
  289.         Action 2: paint a rectangle with the current pattern
  290.         Action 3: erase a rectangle
  291.         Action 4: invert a rectangle
  292.  
  293.     195:    shade a rectangle
  294.             (now ignores rectangle and sets shading for all subsequent drawing
  295.             operations for added flexibility)
  296.             Param 1 = action
  297.             Params 2-5 = left, top, right, bottom of rectangle (ignored)
  298.             Param 6 = percentage of shading to apply (rounded to coincide with
  299.                       Apple-defined constants)
  300.         Action 1: set shading percentage
  301.  
  302.     200:    show a message in an Alert window
  303.             Param 1 = string to display
  304.  
  305.     201:    prompt for a string to be entered by the user
  306.             Param 1 = prompting string
  307.             Param 2 = reply string
  308.     
  309.     202:    display a prompt requiring a yes/no/cancel response
  310.             Param 1 = prompting string
  311.             Param 2 = number of button to highlight (ignored)
  312.             Returns: true if 'yes' is clicked, otherwise false.
  313.  
  314.     203:    prompt for a file name - allows the specification of 
  315.                 a file type to mask unwanted files and will return a fully qualified
  316.                 file name or nil if none is selected or 'cancel' is clicked.
  317.             Param 1 = prompting string (e.g. 'System image:')
  318.             Param 2 = default file name
  319.             Param 3 = flag indicating whether to use a 'save' or an 'open' dialog
  320.             Param 4 = file type to mask for
  321.  
  322.     204:    display an error message
  323.             Param 1 = string to display
  324.         
  325.     205:    beep the system beeper
  326.  
  327.     206:    save/load text pane contents
  328.             Param 1 = pane pointer
  329.             Param 2 = action
  330.             Param 3 = file number (file must be open)
  331.         Action 0: load text
  332.         Action 1: save text
  333.     
  334.     207:    return a fully qualified file name after receipt of an 
  335.             Open Document event with Smalltalk file type prepended.
  336.             (Used for drag'n'drop support).
  337.         
  338.     210:    date and time functions
  339.             Param 1 = action
  340.         Action 1: return the current date and time as a string
  341.         Action 2: return the current day of the week as a number
  342.         Action 3: return the current day of the month as a number
  343.         Action 4: return the current month number
  344.         Action 5: return the current year
  345.  
  346.     254:    return version string from 'vers' resource.
  347.         
  348.     255:    set debug
  349.             Param 1 = action
  350.         Action 1: switch on debugging messages
  351.         Action 2: turn off debugging messages
  352.